import {ENV} from '../libs/environment'

let baseUrl = "http://127.0.0.1:9900";
let prefix = "http://scenictest.1lantech.com/";
const devUrl = "http://192.168.0.15:62000";
const productUrl = "http://www.1lantech.com:62000";
if (ENV == "dev") {
  baseUrl = devUrl;
  prefix = 'http://jyxxtest.1lantech.com/';
} else if (ENV == "product") {
  baseUrl = productUrl;
  prefix = "http://jyxxtest.1lantech.com/";
}

export const SERVICE_URLS = {
  common: {
    imageUpload: {
      path: baseUrl + "/upload/pic",
    },
    editorFileUpload : {
      path : baseUrl + '/upload/editor/files',
      method : 'POST'
    },
    fileUpload : {
      path : baseUrl + "/upload/file"
    },
    fileUploads : {
      path : baseUrl + "/upload/files"
    },
    prefixUrl : {
      path : prefix
    },
    login : {
      path : baseUrl + "/manager/login",
      method : 'POST'
    },
    exit : {
      path : baseUrl + "/manager/loginout",
      method: "GET"
    },
    article : {
      path : baseUrl + "/article",
      method : 'PUT'
    },
    viewArticle : {
      path : baseUrl + '/article/column?articleColumn={articleColumn}&pageNo={pageNo}&pageSize={pageSize}',
      method: "GET"
    }
  },
  teams : {
    page : {
      path : baseUrl + '/card/page?cardColumn={cardColumn}&pageSize={pageSize}&pageNo={pageNo}&keywords={keywords}',
      method: "GET"
    },
    add : {
      path : baseUrl + "/card",
      method : 'POST'
    },
    edit : {
      path : baseUrl + "/card",
      method : 'PUT'
    }
  },
  honor : {
    page : {
      path : baseUrl + '/picture/page?picColumn={picColumn}&pageSize={pageSize}&pageNo={pageNo}&keywords={keywords}',
      method: "GET"
    },
    add : {
      path : baseUrl + "/picture",
      method : 'POST'
    },
    edit : {
      path : baseUrl + "/picture",
      method : 'PUT'
    },
    del : {
      path : baseUrl + "/picture?id={id}",
      method : 'DELETE'
    }
  },
  teachers : {
    page : {
      path : baseUrl + '/card/page?cardColumn={cardColumn}&pageSize={pageSize}&pageNo={pageNo}&keywords={keywords}',
      method: "GET"
    },
    add : {
      path : baseUrl + "/card",
      method : 'POST'
    },
    edit : {
      path : baseUrl + "/card",
      method : 'PUT'
    },
    del : {
      path : baseUrl + "/card?id={id}",
      method : 'DELETE'
    }
  },
  research : {
    page : {
      path : baseUrl + '/article/column?articleColumn={articleColumn}&pageNo={pageNo}&pageSize={pageSize}&keywords={keywords}',
      method: "GET"
    },
    add : {
      path : baseUrl + "/article",
      method : 'POST'
    },
    edit : {
      path : baseUrl + "/article",
      method : 'PUT'
    },
    del : {
      path : baseUrl + "/article?id={id}",
      method : 'DELETE'
    }
  },
  flower : {
    page : {
      path : baseUrl + '/studentHonour/page?grade={grade}&honourName={honourName}&pageNo={pageNo}&pageSize={pageSize}&keywords={keywords}',
      method: "GET"
    },
    add : {
      path : baseUrl + "/studentHonour",
      method : 'POST'
    },
    edit : {
      path : baseUrl + "/studentHonour",
      method : 'PUT'
    },
    del : {
      path : baseUrl + "/studentHonour?id={id}",
      method : 'DELETE'
    }
  },
  article : {
    page : {
      path : baseUrl + '/article/column?articleColumn={articleColumn}&pageNo={pageNo}&pageSize={pageSize}&keywords={keywords}',
      method: "GET"
    },
    add : {
      path : baseUrl + "/article",
      method : 'POST'
    },
    edit : {
      path : baseUrl + "/article",
      method : 'PUT'
    },
    del : {
      path : baseUrl + "/article?id={id}",
      method : 'DELETE'
    }
  },
  live : {
    page : {
      path : baseUrl + '/liveActivity/page?keywords={keywords}&pageNo={pageNo}&pageSize={pageSize}',
      method: "GET"
    },
    add : {
      path : baseUrl + "/liveActivity",
      method : 'POST'
    },
    edit : {
      path : baseUrl + "/liveActivity",
      method : 'PUT'
    },
    del : {
      path : baseUrl + "/liveActivity?id={id}",
      method : 'DELETE'
    }
  },
  mailbox : {
    page : {
      path : baseUrl + '/message/page?pageNo={pageNo}&pageSize={pageSize}&keywords={keywords}',
      method: "GET"
    },
    del : {
      path : baseUrl + "/message?id={id}",
      method : 'DELETE'
    },
    edit : {
      path : baseUrl + '/message',
      method : 'PUT'
    }
  }
}

